home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Goodies / 3rd Party Demos / 3rd Party Plugins / Misc / PEVocoder 1.0 (PPC) / PEVocodePlugin Source Code / spt.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-21  |  1.2 KB  |  52 lines

  1. /* $Id: spt.h,v 1.2 1998/09/13 00:21:18 emanuel Exp $ */
  2.  
  3. #ifndef _SPT_
  4. #define _SPT_
  5.  
  6. #include <stdlib.h>
  7.  
  8. #define MAXLEN        80        /* Usual input line length for prompts */
  9. #define ESC            0x1b
  10. #define ERROR        -1
  11. #define EPSILON     1e-15
  12. #ifndef FALSE
  13. #define FALSE    (1==2)
  14. #endif /* FALSE */
  15. #ifndef TRUE
  16. #define TRUE        (1==1)
  17. #endif /* TRUE */
  18. #define SUCCESS    TRUE
  19. #define FAILURE    FALSE
  20. #ifndef NULL
  21. #define NULL        ((void *)0)
  22. #endif /* NULL */
  23. #ifndef MAXINT
  24. #define MAXINT        ((unsigned)(-1))
  25. #endif /* MAXINT */
  26. #ifndef MAXLONG
  27. #define MAXLONG        ((unsigned long)(-1L))
  28. #endif /* MAXLONG */
  29. #ifndef PI
  30. #define PI            3.14159265358978323846
  31. #endif /* PI */
  32. #define ZERO_C        273.15
  33.  
  34. #define max(a, b)    (((a) > (b)) ? (a) : (b))
  35. #define min(a, b)    (((a) > (b)) ? (b) : (a))
  36. /*#define abs(a)        (((a) < 0) ? (-(a)) : (a))*/
  37. #define sgn(x)        (((x) < 0) ? (-1) : (1))
  38. #define round(x)    (sgn(x)*(int)abs((x) + .5))
  39. #define sqr(x)        ((x)*(x))
  40. #define ln(x)        log(x)
  41. #define power(x, y)    (exp((y)*log(x)))
  42. #define delcrlf(str)    (str[strlen(str)-1] = '\0')
  43.  
  44. /* Used to signify a pointer which is intended to cast into several different
  45.  * types.
  46.  */
  47. #define anyptr        void
  48.  
  49. #define forever     for(;;)
  50.  
  51. #endif /* _SPT */
  52.